import request from '@/utils/request'
export function getLiveRomeList({ status, page }) {
  return request({
    url: '/back/events/live',
    method: 'get',
    params: { type: 'live_list', status, page, paginate: 15 }
  })
}
export function createLiveRome({ name, coverImg, startTime, endTime, anchorName, anchorWechat, shareImg, type, screenType, closeLike, closeGoods, closeComment }) {
  return request({
    url: 'back/events/live',
    method: 'post',
    params: { type: 'goodAdd' },
    data: { name, coverImg, startTime, endTime, anchorName, anchorWechat, shareImg, type, screenType, closeLike, closeGoods, closeComment }
  })
}
export function updateLiveRome() {
  return request({
    url: 'back/events/live',
    method: 'post',
    params: { type: 'renewal' }
  })
}
// 获取直播商品
export function getLiveGoodsList({ status, page }) {
  return request({
    url: 'back/events/live',
    method: 'get',
    params: { type: 'good_list', status, page, paginate: 4 }
  })
}
// 指定直播间导入商品
export function importGoodsToLiveRome({ room_id, good_ids }) {
  return request({
    url: 'back/events/live',
    method: 'post',
    params: { type: 'room_addgoods', room_id, good_ids }
  })
}
// 商品库
export function getGoodsStockList({ status, page }) {
  return request({
    url: 'back/events/live',
    method: 'get',
    params: { type: 'good_list', status, page, paginate: 15 }
  })
}
// 添加直播商品
export function addLiveGoods({ coverImgUrl, name, priceType, price, price2, url }) {
  return request({
    url: 'back/events/live',
    method: 'post',
    data: { coverImgUrl, name, priceType, price, price2, url }
  })
}
// 更新获取小程序后台所有直播商品
export function updateLiveGoods(status) {
  return request({
    url: 'back/events/live',
    method: 'post',
    params: { type: 'getapproved' },
    data: { status }
  })
}
